<%@ include file="/WEB-INF/template/include.jsp"%>
<openmrs:require privilege="Manage Reports" otherwise="/login.htm" redirect="/module/reporting/index.htm" />
<%@ include file="localHeader.jsp"%>

<openmrs:htmlInclude file="/moduleResources/simplelabentry/jquery-1.3.2.min.js" />
<openmrs:htmlInclude file="/scripts/easyAjax.js" />

<script type="text/javascript">
    var $j = jQuery.noConflict();
</script>


<style>
    .desc { display: block; }
    .buttons { margin: 50px; }
    form div { margin: 10px; }


</style>

<div id="container">
    <h1>Lab Order Report </h1>
    <div class="box">
        <form method="post" action="runAndRenderLabOrderReport.htm">
            <input type="hidden" name="action" value="render"/>
            <fieldset>
                <legend>Enter Start Date and End Date</legend>

                <table>
                    <tr>
                        <td>
                            <div>
                                <label class="desc" for="startDate">Start Date</label>
                                <span>
                                    <openmrs:fieldGen type="java.util.Date" formFieldName="startDate" val="" parameters=""/>
                                </span>
                            </div>
                        </td>
                        <td>
                            <div>
                                <label class="desc" for="endDate">End Date</label>
                                <span>
                                    <openmrs:fieldGen type="java.util.Date" formFieldName="endDate" val="" parameters=""/>
                                </span>
                            </div>
                        <td>
                        <td>
                            <div>
                                <label class="desc" for="labList">Select Laboratory</label>
                                <span>
                                    <select name="labName" id="labName" onChange="this.form.submit()">
                                        <option id="select">Select</option>
                                        <c:forEach items="${labList}" var="tabHeading">

                                            <openmrs:hasPrivilege privilege="View ${tabHeading.name}">
                                                <option id="${tabHeading.name}" name="${tabHeading.name}" value="${tabHeading.name}" <c:if test="${!empty param.labName && param.labName == tabHeading.name}">selected="selected"</c:if>><spring:message code="${tabHeading.name}"/></option>
                                            </openmrs:hasPrivilege>
                                        </c:forEach>
                                    </select>
                                </span>
                            </div>
                        <td>
                        <td>
                            <div class="buttons">
                                <span>
                                    <input id="save-button" class="btTxt submit" type="submit" value="Run Report"/>
                                </span>
                            </div>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </form>
    </div>

    <br>
    <b class="boxHeader">Patient Lab Order Report</b>
    <div class="box">
        <form method="get" action="${pageContext.request.contextPath}/module/simplelabentry/printOrderReport.htm">
            <input type="hidden" name="action" value="render"/>
            <fieldset>
                <legend>Enter Date and patient Identifier</legend>
                <table>
                    <tr>
                        <td>
                            <div>
                                <label class="desc" for="patientIdentifier">Enter Patient ID</label>
                                <span>
                                    <input type="text" name="patientIdentifier" class="orderField" value="${param.patientIdentifier}"/>
                                </span>
                            </div>
                        </td>
                        <td>
                            <div>
                                <label class="desc" for="startDate">Start Date</label>
                                <span>
                                    <openmrs:fieldGen type="java.util.Date" formFieldName="startDate" val="" parameters=""/>
                                </span>
                            </div>
                        </td>
                        <td>
                            <div>
                                <label class="desc" for="endDate">End Date</label>
                                <span>
                                    <openmrs:fieldGen type="java.util.Date" formFieldName="endDate" val="" parameters=""/>
                                </span>
                            </div>
                        <td>
                        <td>
                            <div class="buttons">
                                <span>
                                    <input id="print-button" class="btTxt submit" type="submit" value="Print Report"  />
                                </span>
                            </div>
                        </td>
                    </tr>


                </table>
            </fieldset>
        </form>
    </div>

</div>






<%@ include file="/WEB-INF/template/footer.jsp"%>
